package day_1126;

import java.util.*;

/**
 * @author oldliu
 * @since 1.0
 */
public class MapTest {
    public static void main(String[] args) {
        Map<String, String> dict = new HashMap<>();
        dict.put("猪", "pig");
        dict.put("羊", "sheep");
        dict.put("狗", "dog");
        dict.put("python", "蟒蛇");
        Scanner in = new Scanner(System.in);
        System.out.println("输入英文：");
        String eng = in.next();
        if (!dict.containsValue(eng)) {
            System.out.println("没有");
        } else {
            Set<String> set = dict.keySet();
            for (String key : set) {
                String v = dict.get(key);
                if (v.equals(eng)) {
                    System.out.println(key);
                }
            }

//            for (Map.Entry<String, String> entry : dict.entrySet()) {
//                if (entry.getValue().equals(eng)) {
//                    System.out.println(entry.getKey());
//                }
//            }
        }
    }
}
